home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!news
- From: David Brownell <brownell@ix.netcom.com>
- Newsgroups: comp.object,comp.lang.eiffel,comp.lang.c++,comp.lang.beta,comp.lang.java,comp.lang.sather
- Subject: Re: What Should An Exception Handling Do? -- Clarification of rules
- Date: Tue, 26 Mar 1996 16:20:33 -0800
- Organization: Dave's VAX
- Message-ID: <315889D1.3316@ix.netcom.com>
- References: <1996Mar14.155641.4299@schbbs.mot.com> <4irn11$7ln@mimas.brunel.ac.uk> <Pine.Sola.3.91.960322041345.17711C-100000@ux5.cso.uiuc.edu>
- NNTP-Posting-Host: pax-ca23-07.ix.netcom.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-NETCOM-Date: Tue Mar 26 6:28:21 PM CST 1996
- X-Mailer: Mozilla 2.0 (Win95; I)
- CC: brownell@ix.netcom.com
-
- In the context of that "C++ done me wrong" flamage, someone had a
- good point that it's useful to be able to reclaim resources and
- automagically retry.
-
- However, the "resumable exceptions" model seems to be less useful
- than a model that's already possible in C++ and most languages:
- call in those overdue books, taxes, etc. since you know who has them!
- Or even the model that's used in the C++ runtime: set_new_handler()
- is a hook that lets applications free up memory when needed. The same
- can be done on a per-class basis whenever needed.
-
-
- I missed the original posting ... but assuming the title is a good
- summary, I think C++ "catch" clauses should only be responsible
- for fault recovery or reporting. The "clean up" aspects should be
- mapped to classes, like "smart pointers", that release memory and
- other resources as appropriate when they're destroyed as part of the
- stack unwinding that the exception initiated.
- --
- David Brownell <brownell@ix.netcom.com>
- Enjoy the blossoms of Enlightenment in their season
- and harvest the fruit of the right path.
-